#ifndef __RSA_PSS_H
#define __RSA_PSS_H

#ifndef IN
#define IN
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
// Prototype:int RSA_padding_add_PKCS1_PSS(int rsaLen, unsigned char *EM,
//	IN unsigned char *mHash,
//	int hash_alg, int sLen);
// Parameters:
//	rsaLen: The length of RSA modulus in bits;
//	EM: Encoded message after padding.
//	mHash: The digest value.
//	hash_alg: Hash alogorithm, could be the following value:
//		HASH_ALG_SHA1: SHA-1;
//		HASH_ALG_SHA256: SHA-256;
//	sLen: The length of salt data. If it's set to -1, it will be set to the length of digest internally.
// return:
//	1: Succeed;
//	0: Fail;
// remarks: This function is used to pad the original data according to EMSA-PSS encoding rules.
*/
int RSA_padding_add_PKCS1_PSS(int rsaLen, unsigned char *EM,
	unsigned char *mHash,
	int hash_alg, int sLen);

/*
// Prototype:int RSA_verify_PKCS1_PSS(int rsaLen, unsigned char *mHash,
//	int hash_alg, IN unsigned char *EM, int sLen);
// Parameters:
//	rsaLen: The length of RSA modulus in bits;
//	mHash: The digest value.
//	hash_alg: Hash alogorithm, could be the following value:
//		HASH_ALG_SHA1: SHA-1;
//		HASH_ALG_SHA256: SHA-256;
//	EM: Encoded message.
//	sLen: The length of salt data.
// return:
//	1: Succeed;
//	0: Fail;
// remarks: This function is used to check the format of EMSA-PSS padding.
*/
int RSA_verify_PKCS1_PSS(int rsaLen, unsigned char *mHash,
	int hash_alg, unsigned char *EM, int sLen);


#ifdef __cplusplus
}
#endif


#endif // __RSA_PSS_H
